from pymongo import MongoClient


class MongoDBClient:
    def __init__(self) -> None:
        self.client = MongoClient("mongodb://localhost:27017/")
        self.db = self.client["task_db"]
        self.tasks = self.db["tasks"]
        
    def __close__(self):
        self.client.close()


mongodb = MongoDBClient()